{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "be4586c8-61a8-4380-910c-0631a7f19ff6",
   "metadata": {},
   "outputs": [],
   "source": [
    "from gs_quant.instrument import FXOption, FXForward\n",
    "from gs_quant.backtests.triggers import (\n",
    "    PeriodicTrigger,\n",
    "    PeriodicTriggerRequirements,\n",
    "    StrategyRiskTrigger,\n",
    "    RiskTriggerRequirements,\n",
    "    TriggerDirection,\n",
    ")\n",
    "from gs_quant.backtests.actions import AddTradeAction, HedgeAction\n",
    "from gs_quant.backtests.backtest_objects import ScaledTransactionModel\n",
    "from gs_quant.backtests.generic_engine import GenericEngine\n",
    "from gs_quant.backtests.strategy import Strategy\n",
    "from gs_quant.risk import FXDelta\n",
    "\n",
    "import datetime as dt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fcc30104-6f26-48cd-837c-da5021936cfe",
   "metadata": {},
   "outputs": [],
   "source": [
    "from gs_quant.session import GsSession\n",
    "\n",
    "GsSession.use()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6626743-dc9f-427c-bd2a-9b4e7ffb0708",
   "metadata": {},
   "source": [
    "Simplest backtest.  Buy a trade on a periodic basis.  Hold that trade for some number of days and exit the trade.\n",
    "\n",
    "Here we buy an option every day between 4 Aug and 4 Sep and we hold each of those options for 1 week.  We convert this idea into a Strategy object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5663a431-1acf-4c51-8c4f-ac8063163038",
   "metadata": {},
   "outputs": [],
   "source": [
    "opt = FXOption(pair='EURUSD', expiration_date='3m', strike_price='25d', option_type='Call', premium=0)\n",
    "\n",
    "action = AddTradeAction(priceables=opt, trade_duration='1w')\n",
    "trigger = PeriodicTrigger(\n",
    "    trigger_requirements=PeriodicTriggerRequirements(\n",
    "        start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1b'\n",
    "    ),\n",
    "    actions=action,\n",
    ")\n",
    "\n",
    "strategy = Strategy(initial_portfolio=None, triggers=trigger)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0b286ba1-9a01-410e-b6ed-cefed2c8f530",
   "metadata": {},
   "source": [
    "strategy objects can be run by Engines such as the GenericEngine"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e37d9bba-31e0-451d-8767-2c8bce8c6e50",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|███████████████████████████████████████████████████████████████████████████████████| 110/110 [00:18<00:00,  5.83it/s]\n",
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 19/19 [00:06<00:00,  3.09it/s]\n"
     ]
    }
   ],
   "source": [
    "ge = GenericEngine()\n",
    "backtest = ge.run_backtest(strategy=strategy, start=dt.date(2025, 8, 4), end=dt.date(2025, 9, 4), frequency='1b')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2c8d461d-59cb-4768-a7c1-d4c3405628aa",
   "metadata": {},
   "source": [
    "when we run a backtest the engine will move through time from the start to the end and for each date determine if a trigger has triggered and if\n",
    "it has it will apply the action(s) associated with the trigger.  We can see that the backtest result object hold a dictionary of every day in the\n",
    "backtest and the portfolio holding on each date."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ecedf61f-3f16-46bf-bb81-3745539dc28c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "defaultdict(gs_quant.markets.portfolio.Portfolio,\n",
       "            {datetime.date(2025, 8, 4): Portfolio(1 instrument(s)),\n",
       "             datetime.date(2025, 8, 5): Portfolio(2 instrument(s)),\n",
       "             datetime.date(2025, 8, 6): Portfolio(3 instrument(s)),\n",
       "             datetime.date(2025, 8, 7): Portfolio(4 instrument(s)),\n",
       "             datetime.date(2025, 8, 8): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 11): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 12): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 13): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 14): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 15): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 18): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 19): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 20): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 21): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 22): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 25): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 26): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 27): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 28): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 8, 29): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 9, 1): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 9, 2): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 9, 3): Portfolio(5 instrument(s)),\n",
       "             datetime.date(2025, 9, 4): Portfolio(5 instrument(s))})"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "backtest.portfolio_dict"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b8619115-7cad-4c04-8368-0b345994d1db",
   "metadata": {},
   "source": [
    "you can see here that on the first day we have a single option then over the week we add an option but this tops out at 5 options as after this\n",
    "point the we are exiting the positions.\n",
    "\n",
    "the backtest object contains all the positions as above but also all the risks and pvs required for the backtest in the results.  It also has\n",
    "some useful utilities like the result_summary and the trade_ledger"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "2b4b4237-0685-4762-aa8e-11e29bb80dde",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Price</th>\n",
       "      <th>Cumulative Cash</th>\n",
       "      <th>Transaction Costs</th>\n",
       "      <th>Total</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-08-04</th>\n",
       "      <td>7.039538e+05</td>\n",
       "      <td>-7.039538e+05</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-05</th>\n",
       "      <td>1.384686e+06</td>\n",
       "      <td>-1.401329e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-1.664271e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-06</th>\n",
       "      <td>2.438426e+06</td>\n",
       "      <td>-2.120211e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>3.182143e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-07</th>\n",
       "      <td>3.064023e+06</td>\n",
       "      <td>-2.849922e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>2.141012e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-08</th>\n",
       "      <td>3.987985e+06</td>\n",
       "      <td>-3.570582e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>4.174028e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-11</th>\n",
       "      <td>2.955388e+06</td>\n",
       "      <td>-3.617959e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-6.625704e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-12</th>\n",
       "      <td>3.478294e+06</td>\n",
       "      <td>-3.509605e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-3.131080e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-13</th>\n",
       "      <td>3.906875e+06</td>\n",
       "      <td>-3.460997e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>4.458788e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-14</th>\n",
       "      <td>3.141030e+06</td>\n",
       "      <td>-3.517508e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-3.764782e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-15</th>\n",
       "      <td>3.605119e+06</td>\n",
       "      <td>-3.542721e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>6.239791e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-18</th>\n",
       "      <td>2.817288e+06</td>\n",
       "      <td>-3.498368e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-6.810794e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-19</th>\n",
       "      <td>2.913192e+06</td>\n",
       "      <td>-3.585282e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-6.720894e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-20</th>\n",
       "      <td>2.956274e+06</td>\n",
       "      <td>-3.771344e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-8.150702e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-21</th>\n",
       "      <td>2.624439e+06</td>\n",
       "      <td>-3.935025e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-1.310585e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-22</th>\n",
       "      <td>3.989135e+06</td>\n",
       "      <td>-3.956594e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>3.254059e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-25</th>\n",
       "      <td>3.759709e+06</td>\n",
       "      <td>-3.873152e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-1.134430e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-26</th>\n",
       "      <td>3.234885e+06</td>\n",
       "      <td>-3.920626e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-6.857406e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-27</th>\n",
       "      <td>2.738868e+06</td>\n",
       "      <td>-4.047281e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-1.308413e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-28</th>\n",
       "      <td>3.193984e+06</td>\n",
       "      <td>-3.945057e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-7.510734e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-29</th>\n",
       "      <td>3.582485e+06</td>\n",
       "      <td>-4.036871e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-4.543858e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-01</th>\n",
       "      <td>3.694458e+06</td>\n",
       "      <td>-4.100455e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-4.059970e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-02</th>\n",
       "      <td>3.208602e+06</td>\n",
       "      <td>-4.153800e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-9.451980e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-03</th>\n",
       "      <td>3.280696e+06</td>\n",
       "      <td>-4.037686e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-7.569907e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-04</th>\n",
       "      <td>2.838070e+06</td>\n",
       "      <td>-4.147867e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-1.309797e+06</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Price  Cumulative Cash  Transaction Costs         Total\n",
       "2025-08-04  7.039538e+05    -7.039538e+05                  0  0.000000e+00\n",
       "2025-08-05  1.384686e+06    -1.401329e+06                  0 -1.664271e+04\n",
       "2025-08-06  2.438426e+06    -2.120211e+06                  0  3.182143e+05\n",
       "2025-08-07  3.064023e+06    -2.849922e+06                  0  2.141012e+05\n",
       "2025-08-08  3.987985e+06    -3.570582e+06                  0  4.174028e+05\n",
       "2025-08-11  2.955388e+06    -3.617959e+06                  0 -6.625704e+05\n",
       "2025-08-12  3.478294e+06    -3.509605e+06                  0 -3.131080e+04\n",
       "2025-08-13  3.906875e+06    -3.460997e+06                  0  4.458788e+05\n",
       "2025-08-14  3.141030e+06    -3.517508e+06                  0 -3.764782e+05\n",
       "2025-08-15  3.605119e+06    -3.542721e+06                  0  6.239791e+04\n",
       "2025-08-18  2.817288e+06    -3.498368e+06                  0 -6.810794e+05\n",
       "2025-08-19  2.913192e+06    -3.585282e+06                  0 -6.720894e+05\n",
       "2025-08-20  2.956274e+06    -3.771344e+06                  0 -8.150702e+05\n",
       "2025-08-21  2.624439e+06    -3.935025e+06                  0 -1.310585e+06\n",
       "2025-08-22  3.989135e+06    -3.956594e+06                  0  3.254059e+04\n",
       "2025-08-25  3.759709e+06    -3.873152e+06                  0 -1.134430e+05\n",
       "2025-08-26  3.234885e+06    -3.920626e+06                  0 -6.857406e+05\n",
       "2025-08-27  2.738868e+06    -4.047281e+06                  0 -1.308413e+06\n",
       "2025-08-28  3.193984e+06    -3.945057e+06                  0 -7.510734e+05\n",
       "2025-08-29  3.582485e+06    -4.036871e+06                  0 -4.543858e+05\n",
       "2025-09-01  3.694458e+06    -4.100455e+06                  0 -4.059970e+05\n",
       "2025-09-02  3.208602e+06    -4.153800e+06                  0 -9.451980e+05\n",
       "2025-09-03  3.280696e+06    -4.037686e+06                  0 -7.569907e+05\n",
       "2025-09-04  2.838070e+06    -4.147867e+06                  0 -1.309797e+06"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "backtest.result_summary"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "13f6a66e-eec9-4b4b-b35d-5909dcf7a7f8",
   "metadata": {},
   "source": [
    "Now we are going to take this basic example and extend it.  I want to extend the strategy I had above to also hedge the delta risk.  In order\n",
    "to do this I am going to add a hedge action.  A hedge action required the risk you wish to hedge and the instrument you wish to hedge that\n",
    "risk with.  When the hedge action is triggered the engine will calculate the risk and scale the hedge instrument such that the risk is hedged."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "3d9cc0e0-9104-441f-88e1-3d588f1e5b0b",
   "metadata": {},
   "outputs": [],
   "source": [
    "hedge_action = HedgeAction(\n",
    "    risk=FXDelta(aggregation_level='Type'),\n",
    "    priceables=FXForward(pair='EURUSD', settlement_date='2b'),\n",
    "    trade_duration='1b',\n",
    ")  # we are holding our hedge for one day.  So each day a new fwd is being added as a hedge.\n",
    "\n",
    "# Note that we supplied an aggregation level to the risk to ensure the risk comes back as a scalar value.  Finer control of risks can be\n",
    "# achieved by using a risk transformer and supplying this.\n",
    "# Having created our hedge action we can now add it to the list of actions to be run when our trigger is triggered.\n",
    "\n",
    "hedge_trigger = PeriodicTrigger(\n",
    "    trigger_requirements=PeriodicTriggerRequirements(\n",
    "        start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1b'\n",
    "    ),\n",
    "    actions=[action, hedge_action],\n",
    ")  # now when the trigger triggers both actions will be done in order.\n",
    "\n",
    "hedge_strategy = Strategy(initial_portfolio=None, triggers=hedge_trigger)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "859e2ef8-79de-4991-861f-a16bf84bddb6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|███████████████████████████████████████████████████████████████████████████████████| 268/268 [00:22<00:00, 11.77it/s]\n",
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 42/42 [00:09<00:00,  4.42it/s]\n"
     ]
    }
   ],
   "source": [
    "hedge_backtest = ge.run_backtest(\n",
    "    strategy=hedge_strategy, start=dt.date(2025, 8, 4), end=dt.date(2025, 9, 4), frequency='1b'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "985cd029-741c-44c1-9bce-6e850401b483",
   "metadata": {},
   "source": [
    "if we check the result summary for this backtest we can check that the delta is 0 on all dates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "e2bec6c2-72ea-4913-876f-e4f4f86d28de",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Price</th>\n",
       "      <th>FXDelta(aggregation_level:Type)</th>\n",
       "      <th>Cumulative Cash</th>\n",
       "      <th>Transaction Costs</th>\n",
       "      <th>Total</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-08-04</th>\n",
       "      <td>7.039538e+05</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.039538e+05</td>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-05</th>\n",
       "      <td>1.384686e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-1.408141e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-23454.304906</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-06</th>\n",
       "      <td>2.438426e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-2.382851e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>55574.368854</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-07</th>\n",
       "      <td>3.064023e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.024605e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>39417.710660</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-08</th>\n",
       "      <td>3.987985e+06</td>\n",
       "      <td>-1.490116e-08</td>\n",
       "      <td>-4.028740e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-40754.340909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-11</th>\n",
       "      <td>2.955388e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.261150e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-305761.320428</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-12</th>\n",
       "      <td>3.478294e+06</td>\n",
       "      <td>-1.490116e-08</td>\n",
       "      <td>-3.831561e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-353266.819324</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-13</th>\n",
       "      <td>3.906875e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-4.270443e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-363567.721780</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-14</th>\n",
       "      <td>3.141030e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.617677e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-476646.930316</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-15</th>\n",
       "      <td>3.605119e+06</td>\n",
       "      <td>1.490116e-08</td>\n",
       "      <td>-4.124625e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-519505.288948</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-18</th>\n",
       "      <td>2.817288e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.624033e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-806744.825889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-19</th>\n",
       "      <td>2.913192e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.791480e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-878288.088792</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-20</th>\n",
       "      <td>2.956274e+06</td>\n",
       "      <td>1.490116e-08</td>\n",
       "      <td>-3.816132e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-859858.766961</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-21</th>\n",
       "      <td>2.624439e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.433863e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-809423.092240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-22</th>\n",
       "      <td>3.989135e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-4.499546e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-510410.859932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-25</th>\n",
       "      <td>3.759709e+06</td>\n",
       "      <td>1.490116e-08</td>\n",
       "      <td>-4.406246e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-646536.348574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-26</th>\n",
       "      <td>3.234885e+06</td>\n",
       "      <td>-1.490116e-08</td>\n",
       "      <td>-3.690361e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-455476.104749</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-27</th>\n",
       "      <td>2.738868e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.241891e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-503023.803534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-28</th>\n",
       "      <td>3.193984e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.653487e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-459503.049236</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-29</th>\n",
       "      <td>3.582485e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-4.064240e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-481755.283012</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-01</th>\n",
       "      <td>3.694458e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-4.205189e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-510730.793778</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-02</th>\n",
       "      <td>3.208602e+06</td>\n",
       "      <td>-1.490116e-08</td>\n",
       "      <td>-3.698486e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-489883.853533</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-03</th>\n",
       "      <td>3.280696e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.764776e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-484079.900233</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-04</th>\n",
       "      <td>2.838070e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-3.413359e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>-575289.380348</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Price  FXDelta(aggregation_level:Type)  Cumulative Cash  \\\n",
       "2025-08-04  7.039538e+05                     0.000000e+00    -7.039538e+05   \n",
       "2025-08-05  1.384686e+06                     0.000000e+00    -1.408141e+06   \n",
       "2025-08-06  2.438426e+06                     0.000000e+00    -2.382851e+06   \n",
       "2025-08-07  3.064023e+06                     0.000000e+00    -3.024605e+06   \n",
       "2025-08-08  3.987985e+06                    -1.490116e-08    -4.028740e+06   \n",
       "2025-08-11  2.955388e+06                     0.000000e+00    -3.261150e+06   \n",
       "2025-08-12  3.478294e+06                    -1.490116e-08    -3.831561e+06   \n",
       "2025-08-13  3.906875e+06                     0.000000e+00    -4.270443e+06   \n",
       "2025-08-14  3.141030e+06                     0.000000e+00    -3.617677e+06   \n",
       "2025-08-15  3.605119e+06                     1.490116e-08    -4.124625e+06   \n",
       "2025-08-18  2.817288e+06                     0.000000e+00    -3.624033e+06   \n",
       "2025-08-19  2.913192e+06                     0.000000e+00    -3.791480e+06   \n",
       "2025-08-20  2.956274e+06                     1.490116e-08    -3.816132e+06   \n",
       "2025-08-21  2.624439e+06                     0.000000e+00    -3.433863e+06   \n",
       "2025-08-22  3.989135e+06                     0.000000e+00    -4.499546e+06   \n",
       "2025-08-25  3.759709e+06                     1.490116e-08    -4.406246e+06   \n",
       "2025-08-26  3.234885e+06                    -1.490116e-08    -3.690361e+06   \n",
       "2025-08-27  2.738868e+06                     0.000000e+00    -3.241891e+06   \n",
       "2025-08-28  3.193984e+06                     0.000000e+00    -3.653487e+06   \n",
       "2025-08-29  3.582485e+06                     0.000000e+00    -4.064240e+06   \n",
       "2025-09-01  3.694458e+06                     0.000000e+00    -4.205189e+06   \n",
       "2025-09-02  3.208602e+06                    -1.490116e-08    -3.698486e+06   \n",
       "2025-09-03  3.280696e+06                     0.000000e+00    -3.764776e+06   \n",
       "2025-09-04  2.838070e+06                     0.000000e+00    -3.413359e+06   \n",
       "\n",
       "            Transaction Costs          Total  \n",
       "2025-08-04                  0       0.000000  \n",
       "2025-08-05                  0  -23454.304906  \n",
       "2025-08-06                  0   55574.368854  \n",
       "2025-08-07                  0   39417.710660  \n",
       "2025-08-08                  0  -40754.340909  \n",
       "2025-08-11                  0 -305761.320428  \n",
       "2025-08-12                  0 -353266.819324  \n",
       "2025-08-13                  0 -363567.721780  \n",
       "2025-08-14                  0 -476646.930316  \n",
       "2025-08-15                  0 -519505.288948  \n",
       "2025-08-18                  0 -806744.825889  \n",
       "2025-08-19                  0 -878288.088792  \n",
       "2025-08-20                  0 -859858.766961  \n",
       "2025-08-21                  0 -809423.092240  \n",
       "2025-08-22                  0 -510410.859932  \n",
       "2025-08-25                  0 -646536.348574  \n",
       "2025-08-26                  0 -455476.104749  \n",
       "2025-08-27                  0 -503023.803534  \n",
       "2025-08-28                  0 -459503.049236  \n",
       "2025-08-29                  0 -481755.283012  \n",
       "2025-09-01                  0 -510730.793778  \n",
       "2025-09-02                  0 -489883.853533  \n",
       "2025-09-03                  0 -484079.900233  \n",
       "2025-09-04                  0 -575289.380348  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hedge_backtest.result_summary"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "747fe3e4-55cd-4d69-ac17-ed7f74641e9c",
   "metadata": {},
   "source": [
    "now we are going to change this so that instead of buying an option every day we are going to buy every week but still hedge every day.  In\n",
    "order to do this we are going to have two different triggers, one daily and one weekly with different actions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "3477dd7e-e8ba-4fe4-8606-a24867073829",
   "metadata": {},
   "outputs": [],
   "source": [
    "weekly_trigger = PeriodicTrigger(\n",
    "    PeriodicTriggerRequirements(start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1w'),\n",
    "    actions=action,\n",
    ")\n",
    "daily_trigger = PeriodicTrigger(\n",
    "    PeriodicTriggerRequirements(start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1b'),\n",
    "    actions=hedge_action,\n",
    ")\n",
    "\n",
    "hedge_weekly_option_strategy = Strategy(initial_portfolio=None, triggers=[weekly_trigger, daily_trigger])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "41a2bdf3-d5f7-4918-99db-aa09d9768511",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 96/96 [00:13<00:00,  7.00it/s]\n",
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 27/27 [00:03<00:00,  7.41it/s]\n"
     ]
    }
   ],
   "source": [
    "hedge_weekly_option_backtest = ge.run_backtest(\n",
    "    strategy=hedge_weekly_option_strategy, start=dt.date(2025, 8, 4), end=dt.date(2025, 9, 4), frequency='1b'\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "862b0f31-cad5-444a-89cc-470147508535",
   "metadata": {},
   "source": [
    "if we look at the trade ledger for this backtest we can see that options are bought weekly but hedges are still done daily"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "68924907-74d0-4b8c-88ab-6f2e9b6b8d5e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>Close</th>\n",
       "      <th>Open Value</th>\n",
       "      <th>Close Value</th>\n",
       "      <th>Long Short</th>\n",
       "      <th>Status</th>\n",
       "      <th>Trade PnL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Action1_Priceable0_2025-08-04</th>\n",
       "      <td>2025-08-04</td>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>-703953.846673</td>\n",
       "      <td>637865.502946</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-66088.343728</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action1_Priceable0_2025-08-11</th>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>-685241.75833</td>\n",
       "      <td>685891.313071</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>649.554742</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action1_Priceable0_2025-08-18</th>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>-641537.745143</td>\n",
       "      <td>747562.463969</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>106024.718826</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action1_Priceable0_2025-08-25</th>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>-664120.360966</td>\n",
       "      <td>608390.108042</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-55730.252924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action1_Priceable0_2025-09-01</th>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>None</td>\n",
       "      <td>-671974.304719</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>open</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-04</th>\n",
       "      <td>2025-08-04</td>\n",
       "      <td>2025-08-05</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>-6811.598662</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-6811.59862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-05</th>\n",
       "      <td>2025-08-05</td>\n",
       "      <td>2025-08-06</td>\n",
       "      <td>-0.000076</td>\n",
       "      <td>-127463.975776</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-127463.975852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-06</th>\n",
       "      <td>2025-08-06</td>\n",
       "      <td>2025-08-07</td>\n",
       "      <td>-0.000068</td>\n",
       "      <td>30876.67724</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>30876.677172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-07</th>\n",
       "      <td>2025-08-07</td>\n",
       "      <td>2025-08-08</td>\n",
       "      <td>0.000019</td>\n",
       "      <td>-76216.870412</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-76216.870393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-08</th>\n",
       "      <td>2025-08-08</td>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>0.000098</td>\n",
       "      <td>180086.64404</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>180086.644138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-11</th>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>2025-08-12</td>\n",
       "      <td>0.000069</td>\n",
       "      <td>-153650.797851</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-153650.797782</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-12</th>\n",
       "      <td>2025-08-12</td>\n",
       "      <td>2025-08-13</td>\n",
       "      <td>-0.000055</td>\n",
       "      <td>-114033.030923</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-114033.030979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-13</th>\n",
       "      <td>2025-08-13</td>\n",
       "      <td>2025-08-14</td>\n",
       "      <td>0.000085</td>\n",
       "      <td>168857.202827</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>168857.202912</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-14</th>\n",
       "      <td>2025-08-14</td>\n",
       "      <td>2025-08-15</td>\n",
       "      <td>-0.000076</td>\n",
       "      <td>-114516.597115</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-114516.597192</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-15</th>\n",
       "      <td>2025-08-15</td>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>0.000118</td>\n",
       "      <td>108502.142566</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>108502.142684</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-18</th>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>2025-08-19</td>\n",
       "      <td>0.000105</td>\n",
       "      <td>-17902.333232</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-17902.333127</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-19</th>\n",
       "      <td>2025-08-19</td>\n",
       "      <td>2025-08-20</td>\n",
       "      <td>0.000097</td>\n",
       "      <td>35228.088101</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>35228.088198</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-20</th>\n",
       "      <td>2025-08-20</td>\n",
       "      <td>2025-08-21</td>\n",
       "      <td>-0.000089</td>\n",
       "      <td>113097.124562</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>113097.124474</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-21</th>\n",
       "      <td>2025-08-21</td>\n",
       "      <td>2025-08-22</td>\n",
       "      <td>0.000051</td>\n",
       "      <td>-205754.054176</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-205754.054125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-22</th>\n",
       "      <td>2025-08-22</td>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>1953.316272</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>1953.316294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-25</th>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>2025-08-26</td>\n",
       "      <td>0.000049</td>\n",
       "      <td>133874.524524</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>133874.524574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-26</th>\n",
       "      <td>2025-08-26</td>\n",
       "      <td>2025-08-27</td>\n",
       "      <td>0.000089</td>\n",
       "      <td>100261.657657</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>100261.657746</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-27</th>\n",
       "      <td>2025-08-27</td>\n",
       "      <td>2025-08-28</td>\n",
       "      <td>-0.000054</td>\n",
       "      <td>-85779.392115</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-85779.392169</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-28</th>\n",
       "      <td>2025-08-28</td>\n",
       "      <td>2025-08-29</td>\n",
       "      <td>-0.000085</td>\n",
       "      <td>-55443.513444</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-55443.513529</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-08-29</th>\n",
       "      <td>2025-08-29</td>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>-0.000073</td>\n",
       "      <td>-13212.896855</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-13212.896928</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-09-01</th>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>2025-09-02</td>\n",
       "      <td>-0.000107</td>\n",
       "      <td>101496.323024</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>101496.322917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-09-02</th>\n",
       "      <td>2025-09-02</td>\n",
       "      <td>2025-09-03</td>\n",
       "      <td>-0.00001</td>\n",
       "      <td>-32662.887524</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-32662.887534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-09-03</th>\n",
       "      <td>2025-09-03</td>\n",
       "      <td>2025-09-04</td>\n",
       "      <td>0.000079</td>\n",
       "      <td>86025.151973</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>86025.152052</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action2_Priceable0_2025-09-04</th>\n",
       "      <td>2025-09-04</td>\n",
       "      <td>None</td>\n",
       "      <td>-0.000077</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>open</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     Open       Close     Open Value  \\\n",
       "Action1_Priceable0_2025-08-04  2025-08-04  2025-08-11 -703953.846673   \n",
       "Action1_Priceable0_2025-08-11  2025-08-11  2025-08-18  -685241.75833   \n",
       "Action1_Priceable0_2025-08-18  2025-08-18  2025-08-25 -641537.745143   \n",
       "Action1_Priceable0_2025-08-25  2025-08-25  2025-09-01 -664120.360966   \n",
       "Action1_Priceable0_2025-09-01  2025-09-01        None -671974.304719   \n",
       "Action2_Priceable0_2025-08-04  2025-08-04  2025-08-05       0.000042   \n",
       "Action2_Priceable0_2025-08-05  2025-08-05  2025-08-06      -0.000076   \n",
       "Action2_Priceable0_2025-08-06  2025-08-06  2025-08-07      -0.000068   \n",
       "Action2_Priceable0_2025-08-07  2025-08-07  2025-08-08       0.000019   \n",
       "Action2_Priceable0_2025-08-08  2025-08-08  2025-08-11       0.000098   \n",
       "Action2_Priceable0_2025-08-11  2025-08-11  2025-08-12       0.000069   \n",
       "Action2_Priceable0_2025-08-12  2025-08-12  2025-08-13      -0.000055   \n",
       "Action2_Priceable0_2025-08-13  2025-08-13  2025-08-14       0.000085   \n",
       "Action2_Priceable0_2025-08-14  2025-08-14  2025-08-15      -0.000076   \n",
       "Action2_Priceable0_2025-08-15  2025-08-15  2025-08-18       0.000118   \n",
       "Action2_Priceable0_2025-08-18  2025-08-18  2025-08-19       0.000105   \n",
       "Action2_Priceable0_2025-08-19  2025-08-19  2025-08-20       0.000097   \n",
       "Action2_Priceable0_2025-08-20  2025-08-20  2025-08-21      -0.000089   \n",
       "Action2_Priceable0_2025-08-21  2025-08-21  2025-08-22       0.000051   \n",
       "Action2_Priceable0_2025-08-22  2025-08-22  2025-08-25       0.000022   \n",
       "Action2_Priceable0_2025-08-25  2025-08-25  2025-08-26       0.000049   \n",
       "Action2_Priceable0_2025-08-26  2025-08-26  2025-08-27       0.000089   \n",
       "Action2_Priceable0_2025-08-27  2025-08-27  2025-08-28      -0.000054   \n",
       "Action2_Priceable0_2025-08-28  2025-08-28  2025-08-29      -0.000085   \n",
       "Action2_Priceable0_2025-08-29  2025-08-29  2025-09-01      -0.000073   \n",
       "Action2_Priceable0_2025-09-01  2025-09-01  2025-09-02      -0.000107   \n",
       "Action2_Priceable0_2025-09-02  2025-09-02  2025-09-03       -0.00001   \n",
       "Action2_Priceable0_2025-09-03  2025-09-03  2025-09-04       0.000079   \n",
       "Action2_Priceable0_2025-09-04  2025-09-04        None      -0.000077   \n",
       "\n",
       "                                 Close Value Long Short  Status      Trade PnL  \n",
       "Action1_Priceable0_2025-08-04  637865.502946         -1  closed  -66088.343728  \n",
       "Action1_Priceable0_2025-08-11  685891.313071         -1  closed     649.554742  \n",
       "Action1_Priceable0_2025-08-18  747562.463969         -1  closed  106024.718826  \n",
       "Action1_Priceable0_2025-08-25  608390.108042         -1  closed  -55730.252924  \n",
       "Action1_Priceable0_2025-09-01              0         -1    open           None  \n",
       "Action2_Priceable0_2025-08-04   -6811.598662         -1  closed    -6811.59862  \n",
       "Action2_Priceable0_2025-08-05 -127463.975776         -1  closed -127463.975852  \n",
       "Action2_Priceable0_2025-08-06    30876.67724         -1  closed   30876.677172  \n",
       "Action2_Priceable0_2025-08-07  -76216.870412         -1  closed  -76216.870393  \n",
       "Action2_Priceable0_2025-08-08   180086.64404         -1  closed  180086.644138  \n",
       "Action2_Priceable0_2025-08-11 -153650.797851         -1  closed -153650.797782  \n",
       "Action2_Priceable0_2025-08-12 -114033.030923         -1  closed -114033.030979  \n",
       "Action2_Priceable0_2025-08-13  168857.202827         -1  closed  168857.202912  \n",
       "Action2_Priceable0_2025-08-14 -114516.597115         -1  closed -114516.597192  \n",
       "Action2_Priceable0_2025-08-15  108502.142566         -1  closed  108502.142684  \n",
       "Action2_Priceable0_2025-08-18  -17902.333232         -1  closed  -17902.333127  \n",
       "Action2_Priceable0_2025-08-19   35228.088101         -1  closed   35228.088198  \n",
       "Action2_Priceable0_2025-08-20  113097.124562         -1  closed  113097.124474  \n",
       "Action2_Priceable0_2025-08-21 -205754.054176         -1  closed -205754.054125  \n",
       "Action2_Priceable0_2025-08-22    1953.316272         -1  closed    1953.316294  \n",
       "Action2_Priceable0_2025-08-25  133874.524524         -1  closed  133874.524574  \n",
       "Action2_Priceable0_2025-08-26  100261.657657         -1  closed  100261.657746  \n",
       "Action2_Priceable0_2025-08-27  -85779.392115         -1  closed  -85779.392169  \n",
       "Action2_Priceable0_2025-08-28  -55443.513444         -1  closed  -55443.513529  \n",
       "Action2_Priceable0_2025-08-29  -13212.896855         -1  closed  -13212.896928  \n",
       "Action2_Priceable0_2025-09-01  101496.323024         -1  closed  101496.322917  \n",
       "Action2_Priceable0_2025-09-02  -32662.887524         -1  closed  -32662.887534  \n",
       "Action2_Priceable0_2025-09-03   86025.151973         -1  closed   86025.152052  \n",
       "Action2_Priceable0_2025-09-04              0         -1    open           None  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hedge_weekly_option_backtest.trade_ledger()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2ea54ad1-a7a7-4013-aa29-b21b4f6cd58f",
   "metadata": {},
   "source": [
    "it would be useful if the name of the trades was more human readable.\n",
    "We can control this by naming the trade and the actions.  Then the name of the instrument would be the action name_trade name_date the trade was\n",
    "entered."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "dd2448dd-e335-42a2-b659-2248e66f0280",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 96/96 [00:17<00:00,  5.57it/s]\n",
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 27/27 [00:08<00:00,  3.21it/s]\n"
     ]
    }
   ],
   "source": [
    "opt = FXOption(pair='EURUSD', expiration_date='3m', strike_price='25d', premium=0, name='EURUSD call')\n",
    "add_action = AddTradeAction(priceables=opt, trade_duration='1w', name='add action')\n",
    "fwd = FXForward(pair='EURUSD', settlement_date='2b', name='spot hedge')\n",
    "named_hedge_action = HedgeAction(\n",
    "    risk=FXDelta(aggregation_level='Type'), priceables=fwd, trade_duration='1b', name='hedge action'\n",
    ")\n",
    "\n",
    "weekly_trigger = PeriodicTrigger(\n",
    "    PeriodicTriggerRequirements(start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1w'),\n",
    "    actions=add_action,\n",
    ")\n",
    "daily_trigger = PeriodicTrigger(\n",
    "    PeriodicTriggerRequirements(start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1b'),\n",
    "    actions=named_hedge_action,\n",
    ")\n",
    "\n",
    "hedge_weekly_option_strategy = Strategy(initial_portfolio=None, triggers=[weekly_trigger, daily_trigger])\n",
    "hedge_weekly_option_backtest = ge.run_backtest(\n",
    "    strategy=hedge_weekly_option_strategy, start=dt.date(2025, 8, 4), end=dt.date(2025, 9, 4), frequency='1b'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "2691a8a3-c784-4d3d-be4c-42c1be7a40d9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>Close</th>\n",
       "      <th>Open Value</th>\n",
       "      <th>Close Value</th>\n",
       "      <th>Long Short</th>\n",
       "      <th>Status</th>\n",
       "      <th>Trade PnL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-04</th>\n",
       "      <td>2025-08-04</td>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>-703953.846673</td>\n",
       "      <td>637865.502946</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-66088.343728</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-11</th>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>-685241.75833</td>\n",
       "      <td>685891.313071</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>649.554742</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-18</th>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>-641537.745143</td>\n",
       "      <td>747562.463969</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>106024.718826</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-25</th>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>-664120.360966</td>\n",
       "      <td>608390.108042</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-55730.252924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-09-01</th>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>None</td>\n",
       "      <td>-671974.304719</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>open</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-04</th>\n",
       "      <td>2025-08-04</td>\n",
       "      <td>2025-08-05</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>-6811.598662</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-6811.59862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-05</th>\n",
       "      <td>2025-08-05</td>\n",
       "      <td>2025-08-06</td>\n",
       "      <td>-0.000076</td>\n",
       "      <td>-127463.975776</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-127463.975852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-06</th>\n",
       "      <td>2025-08-06</td>\n",
       "      <td>2025-08-07</td>\n",
       "      <td>-0.000068</td>\n",
       "      <td>30876.67724</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>30876.677172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-07</th>\n",
       "      <td>2025-08-07</td>\n",
       "      <td>2025-08-08</td>\n",
       "      <td>0.000019</td>\n",
       "      <td>-76216.870412</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-76216.870393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-08</th>\n",
       "      <td>2025-08-08</td>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>0.000098</td>\n",
       "      <td>180086.64404</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>180086.644138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-11</th>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>2025-08-12</td>\n",
       "      <td>0.000069</td>\n",
       "      <td>-153650.797851</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-153650.797782</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-12</th>\n",
       "      <td>2025-08-12</td>\n",
       "      <td>2025-08-13</td>\n",
       "      <td>-0.000055</td>\n",
       "      <td>-114033.030923</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-114033.030978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-13</th>\n",
       "      <td>2025-08-13</td>\n",
       "      <td>2025-08-14</td>\n",
       "      <td>0.000085</td>\n",
       "      <td>168857.202827</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>168857.202912</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-14</th>\n",
       "      <td>2025-08-14</td>\n",
       "      <td>2025-08-15</td>\n",
       "      <td>-0.000076</td>\n",
       "      <td>-114516.597122</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-114516.597199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-15</th>\n",
       "      <td>2025-08-15</td>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>0.000118</td>\n",
       "      <td>108502.142565</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>108502.142683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-18</th>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>2025-08-19</td>\n",
       "      <td>0.000104</td>\n",
       "      <td>-17902.333232</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-17902.333128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-19</th>\n",
       "      <td>2025-08-19</td>\n",
       "      <td>2025-08-20</td>\n",
       "      <td>0.000097</td>\n",
       "      <td>35228.088102</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>35228.088199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-20</th>\n",
       "      <td>2025-08-20</td>\n",
       "      <td>2025-08-21</td>\n",
       "      <td>-0.000088</td>\n",
       "      <td>113097.124563</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>113097.124475</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-21</th>\n",
       "      <td>2025-08-21</td>\n",
       "      <td>2025-08-22</td>\n",
       "      <td>0.000054</td>\n",
       "      <td>-205754.054176</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-205754.054122</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-22</th>\n",
       "      <td>2025-08-22</td>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>1953.316272</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>1953.316294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-25</th>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>2025-08-26</td>\n",
       "      <td>0.000049</td>\n",
       "      <td>133874.524524</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>133874.524573</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-26</th>\n",
       "      <td>2025-08-26</td>\n",
       "      <td>2025-08-27</td>\n",
       "      <td>0.000088</td>\n",
       "      <td>100261.657657</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>100261.657745</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-27</th>\n",
       "      <td>2025-08-27</td>\n",
       "      <td>2025-08-28</td>\n",
       "      <td>-0.000054</td>\n",
       "      <td>-85779.392115</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-85779.392169</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-28</th>\n",
       "      <td>2025-08-28</td>\n",
       "      <td>2025-08-29</td>\n",
       "      <td>-0.000085</td>\n",
       "      <td>-55443.513444</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-55443.513529</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-29</th>\n",
       "      <td>2025-08-29</td>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>-0.000073</td>\n",
       "      <td>-13212.896855</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-13212.896928</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-09-01</th>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>2025-09-02</td>\n",
       "      <td>0.000107</td>\n",
       "      <td>101496.32281</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>101496.322917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-09-02</th>\n",
       "      <td>2025-09-02</td>\n",
       "      <td>2025-09-03</td>\n",
       "      <td>-0.00001</td>\n",
       "      <td>-32662.887524</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-32662.887534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-09-03</th>\n",
       "      <td>2025-09-03</td>\n",
       "      <td>2025-09-04</td>\n",
       "      <td>0.000079</td>\n",
       "      <td>86025.151973</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>86025.152052</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-09-04</th>\n",
       "      <td>2025-09-04</td>\n",
       "      <td>None</td>\n",
       "      <td>-0.000077</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>open</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          Open       Close     Open Value  \\\n",
       "add action_EURUSD call_2025-08-04   2025-08-04  2025-08-11 -703953.846673   \n",
       "add action_EURUSD call_2025-08-11   2025-08-11  2025-08-18  -685241.75833   \n",
       "add action_EURUSD call_2025-08-18   2025-08-18  2025-08-25 -641537.745143   \n",
       "add action_EURUSD call_2025-08-25   2025-08-25  2025-09-01 -664120.360966   \n",
       "add action_EURUSD call_2025-09-01   2025-09-01        None -671974.304719   \n",
       "hedge action_spot hedge_2025-08-04  2025-08-04  2025-08-05       0.000042   \n",
       "hedge action_spot hedge_2025-08-05  2025-08-05  2025-08-06      -0.000076   \n",
       "hedge action_spot hedge_2025-08-06  2025-08-06  2025-08-07      -0.000068   \n",
       "hedge action_spot hedge_2025-08-07  2025-08-07  2025-08-08       0.000019   \n",
       "hedge action_spot hedge_2025-08-08  2025-08-08  2025-08-11       0.000098   \n",
       "hedge action_spot hedge_2025-08-11  2025-08-11  2025-08-12       0.000069   \n",
       "hedge action_spot hedge_2025-08-12  2025-08-12  2025-08-13      -0.000055   \n",
       "hedge action_spot hedge_2025-08-13  2025-08-13  2025-08-14       0.000085   \n",
       "hedge action_spot hedge_2025-08-14  2025-08-14  2025-08-15      -0.000076   \n",
       "hedge action_spot hedge_2025-08-15  2025-08-15  2025-08-18       0.000118   \n",
       "hedge action_spot hedge_2025-08-18  2025-08-18  2025-08-19       0.000104   \n",
       "hedge action_spot hedge_2025-08-19  2025-08-19  2025-08-20       0.000097   \n",
       "hedge action_spot hedge_2025-08-20  2025-08-20  2025-08-21      -0.000088   \n",
       "hedge action_spot hedge_2025-08-21  2025-08-21  2025-08-22       0.000054   \n",
       "hedge action_spot hedge_2025-08-22  2025-08-22  2025-08-25       0.000022   \n",
       "hedge action_spot hedge_2025-08-25  2025-08-25  2025-08-26       0.000049   \n",
       "hedge action_spot hedge_2025-08-26  2025-08-26  2025-08-27       0.000088   \n",
       "hedge action_spot hedge_2025-08-27  2025-08-27  2025-08-28      -0.000054   \n",
       "hedge action_spot hedge_2025-08-28  2025-08-28  2025-08-29      -0.000085   \n",
       "hedge action_spot hedge_2025-08-29  2025-08-29  2025-09-01      -0.000073   \n",
       "hedge action_spot hedge_2025-09-01  2025-09-01  2025-09-02       0.000107   \n",
       "hedge action_spot hedge_2025-09-02  2025-09-02  2025-09-03       -0.00001   \n",
       "hedge action_spot hedge_2025-09-03  2025-09-03  2025-09-04       0.000079   \n",
       "hedge action_spot hedge_2025-09-04  2025-09-04        None      -0.000077   \n",
       "\n",
       "                                      Close Value Long Short  Status  \\\n",
       "add action_EURUSD call_2025-08-04   637865.502946         -1  closed   \n",
       "add action_EURUSD call_2025-08-11   685891.313071         -1  closed   \n",
       "add action_EURUSD call_2025-08-18   747562.463969         -1  closed   \n",
       "add action_EURUSD call_2025-08-25   608390.108042         -1  closed   \n",
       "add action_EURUSD call_2025-09-01               0         -1    open   \n",
       "hedge action_spot hedge_2025-08-04   -6811.598662         -1  closed   \n",
       "hedge action_spot hedge_2025-08-05 -127463.975776         -1  closed   \n",
       "hedge action_spot hedge_2025-08-06    30876.67724         -1  closed   \n",
       "hedge action_spot hedge_2025-08-07  -76216.870412         -1  closed   \n",
       "hedge action_spot hedge_2025-08-08   180086.64404         -1  closed   \n",
       "hedge action_spot hedge_2025-08-11 -153650.797851         -1  closed   \n",
       "hedge action_spot hedge_2025-08-12 -114033.030923         -1  closed   \n",
       "hedge action_spot hedge_2025-08-13  168857.202827         -1  closed   \n",
       "hedge action_spot hedge_2025-08-14 -114516.597122         -1  closed   \n",
       "hedge action_spot hedge_2025-08-15  108502.142565         -1  closed   \n",
       "hedge action_spot hedge_2025-08-18  -17902.333232         -1  closed   \n",
       "hedge action_spot hedge_2025-08-19   35228.088102         -1  closed   \n",
       "hedge action_spot hedge_2025-08-20  113097.124563         -1  closed   \n",
       "hedge action_spot hedge_2025-08-21 -205754.054176         -1  closed   \n",
       "hedge action_spot hedge_2025-08-22    1953.316272         -1  closed   \n",
       "hedge action_spot hedge_2025-08-25  133874.524524         -1  closed   \n",
       "hedge action_spot hedge_2025-08-26  100261.657657         -1  closed   \n",
       "hedge action_spot hedge_2025-08-27  -85779.392115         -1  closed   \n",
       "hedge action_spot hedge_2025-08-28  -55443.513444         -1  closed   \n",
       "hedge action_spot hedge_2025-08-29  -13212.896855         -1  closed   \n",
       "hedge action_spot hedge_2025-09-01   101496.32281         -1  closed   \n",
       "hedge action_spot hedge_2025-09-02  -32662.887524         -1  closed   \n",
       "hedge action_spot hedge_2025-09-03   86025.151973         -1  closed   \n",
       "hedge action_spot hedge_2025-09-04              0         -1    open   \n",
       "\n",
       "                                        Trade PnL  \n",
       "add action_EURUSD call_2025-08-04   -66088.343728  \n",
       "add action_EURUSD call_2025-08-11      649.554742  \n",
       "add action_EURUSD call_2025-08-18   106024.718826  \n",
       "add action_EURUSD call_2025-08-25   -55730.252924  \n",
       "add action_EURUSD call_2025-09-01            None  \n",
       "hedge action_spot hedge_2025-08-04    -6811.59862  \n",
       "hedge action_spot hedge_2025-08-05 -127463.975852  \n",
       "hedge action_spot hedge_2025-08-06   30876.677172  \n",
       "hedge action_spot hedge_2025-08-07  -76216.870393  \n",
       "hedge action_spot hedge_2025-08-08  180086.644138  \n",
       "hedge action_spot hedge_2025-08-11 -153650.797782  \n",
       "hedge action_spot hedge_2025-08-12 -114033.030978  \n",
       "hedge action_spot hedge_2025-08-13  168857.202912  \n",
       "hedge action_spot hedge_2025-08-14 -114516.597199  \n",
       "hedge action_spot hedge_2025-08-15  108502.142683  \n",
       "hedge action_spot hedge_2025-08-18  -17902.333128  \n",
       "hedge action_spot hedge_2025-08-19   35228.088199  \n",
       "hedge action_spot hedge_2025-08-20  113097.124475  \n",
       "hedge action_spot hedge_2025-08-21 -205754.054122  \n",
       "hedge action_spot hedge_2025-08-22    1953.316294  \n",
       "hedge action_spot hedge_2025-08-25  133874.524573  \n",
       "hedge action_spot hedge_2025-08-26  100261.657745  \n",
       "hedge action_spot hedge_2025-08-27  -85779.392169  \n",
       "hedge action_spot hedge_2025-08-28  -55443.513529  \n",
       "hedge action_spot hedge_2025-08-29  -13212.896928  \n",
       "hedge action_spot hedge_2025-09-01  101496.322917  \n",
       "hedge action_spot hedge_2025-09-02  -32662.887534  \n",
       "hedge action_spot hedge_2025-09-03   86025.152052  \n",
       "hedge action_spot hedge_2025-09-04           None  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hedge_weekly_option_backtest.trade_ledger()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "98566c1f-97aa-4034-8288-ac36ac9ce788",
   "metadata": {},
   "source": [
    "that's great but in reality we are trading all these instrument at mid which isn't very likely.  We should add some transaction costs\n",
    "into the backtest to get something which mirrors reality better"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "058fca5d-8068-48d7-ada6-b819e96bd64c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 96/96 [00:18<00:00,  5.26it/s]\n",
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 27/27 [00:13<00:00,  1.95it/s]\n"
     ]
    }
   ],
   "source": [
    "t_cost = ScaledTransactionModel(\n",
    "    'notional_amount', 0.00005\n",
    ")  # We are going to add a 0.5bp transaction cost.  We could have charge scaled by risk as well\n",
    "add_action_tcost = AddTradeAction(priceables=opt, trade_duration='1w', name='add action', transaction_cost=t_cost)\n",
    "named_hedge_action_tcost = HedgeAction(\n",
    "    risk=FXDelta(aggregation_level='Type'),\n",
    "    priceables=fwd,\n",
    "    trade_duration='1b',\n",
    "    name='hedge action',\n",
    "    transaction_cost=t_cost,\n",
    ")\n",
    "\n",
    "weekly_trigger_tcost = PeriodicTrigger(\n",
    "    PeriodicTriggerRequirements(start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1w'),\n",
    "    actions=add_action_tcost,\n",
    ")\n",
    "daily_trigger_tcost = PeriodicTrigger(\n",
    "    PeriodicTriggerRequirements(start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1b'),\n",
    "    actions=named_hedge_action_tcost,\n",
    ")\n",
    "\n",
    "hedge_weekly_option_strategy_tcost = Strategy(\n",
    "    initial_portfolio=None, triggers=[weekly_trigger_tcost, daily_trigger_tcost]\n",
    ")\n",
    "hedge_weekly_option_backtest_tcost = ge.run_backtest(\n",
    "    strategy=hedge_weekly_option_strategy_tcost, start=dt.date(2025, 8, 4), end=dt.date(2025, 9, 4), frequency='1b'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "1c5dca41-84cf-4f4e-849c-c89846c1f85a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Price</th>\n",
       "      <th>FXDelta(aggregation_level:Type)</th>\n",
       "      <th>Cumulative Cash</th>\n",
       "      <th>Transaction Costs</th>\n",
       "      <th>Total</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-08-04</th>\n",
       "      <td>703953.846631</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.039538e+05</td>\n",
       "      <td>-6051.326333</td>\n",
       "      <td>-6051.326333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-05</th>\n",
       "      <td>687311.140464</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.107654e+05</td>\n",
       "      <td>-8152.522301</td>\n",
       "      <td>-31606.827207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-06</th>\n",
       "      <td>854096.726246</td>\n",
       "      <td>-3.725290e-09</td>\n",
       "      <td>-8.382294e+05</td>\n",
       "      <td>-10459.843280</td>\n",
       "      <td>5407.461751</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-07</th>\n",
       "      <td>816927.558111</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-8.073527e+05</td>\n",
       "      <td>-12918.673655</td>\n",
       "      <td>-3343.859500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-08</th>\n",
       "      <td>872578.098512</td>\n",
       "      <td>3.725290e-09</td>\n",
       "      <td>-8.835696e+05</td>\n",
       "      <td>-15413.046675</td>\n",
       "      <td>-26404.562434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-11</th>\n",
       "      <td>685241.758261</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.508592e+05</td>\n",
       "      <td>-27756.869337</td>\n",
       "      <td>-93374.336621</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-12</th>\n",
       "      <td>828486.344621</td>\n",
       "      <td>3.725290e-09</td>\n",
       "      <td>-9.045100e+05</td>\n",
       "      <td>-30066.308412</td>\n",
       "      <td>-106089.987243</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-13</th>\n",
       "      <td>941680.896567</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-1.018543e+06</td>\n",
       "      <td>-32748.850904</td>\n",
       "      <td>-109611.008628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-14</th>\n",
       "      <td>749260.469448</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-8.496859e+05</td>\n",
       "      <td>-35363.040760</td>\n",
       "      <td>-135788.422853</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-15</th>\n",
       "      <td>856628.384519</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-9.642024e+05</td>\n",
       "      <td>-37917.845073</td>\n",
       "      <td>-145491.909092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-18</th>\n",
       "      <td>641537.745039</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-8.113467e+05</td>\n",
       "      <td>-50344.674601</td>\n",
       "      <td>-220153.667502</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-19</th>\n",
       "      <td>644700.871014</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-8.292491e+05</td>\n",
       "      <td>-52490.475935</td>\n",
       "      <td>-237038.675995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-20</th>\n",
       "      <td>613688.205925</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.940210e+05</td>\n",
       "      <td>-54613.777845</td>\n",
       "      <td>-234946.554981</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-21</th>\n",
       "      <td>511073.268607</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-6.809239e+05</td>\n",
       "      <td>-56539.135316</td>\n",
       "      <td>-226389.725156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-22</th>\n",
       "      <td>776543.772222</td>\n",
       "      <td>-3.725290e-09</td>\n",
       "      <td>-8.866779e+05</td>\n",
       "      <td>-58690.329946</td>\n",
       "      <td>-168824.470327</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-25</th>\n",
       "      <td>664120.360916</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-8.012825e+05</td>\n",
       "      <td>-71027.812708</td>\n",
       "      <td>-208189.945069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-26</th>\n",
       "      <td>564999.536562</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-6.674080e+05</td>\n",
       "      <td>-73018.588822</td>\n",
       "      <td>-175427.020925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-27</th>\n",
       "      <td>455386.855034</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-5.671463e+05</td>\n",
       "      <td>-74700.472260</td>\n",
       "      <td>-186459.928287</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-28</th>\n",
       "      <td>548765.159018</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-6.529257e+05</td>\n",
       "      <td>-76370.066582</td>\n",
       "      <td>-180530.610827</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-29</th>\n",
       "      <td>600466.953945</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.083692e+05</td>\n",
       "      <td>-78259.895976</td>\n",
       "      <td>-186162.158810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-01</th>\n",
       "      <td>671974.304612</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.851663e+05</td>\n",
       "      <td>-90314.567163</td>\n",
       "      <td>-203506.572755</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-02</th>\n",
       "      <td>573496.579288</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-6.836700e+05</td>\n",
       "      <td>-92322.836654</td>\n",
       "      <td>-202496.244769</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-03</th>\n",
       "      <td>607131.223236</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-7.163329e+05</td>\n",
       "      <td>-94248.276676</td>\n",
       "      <td>-203449.928287</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-04</th>\n",
       "      <td>503559.330516</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-6.303077e+05</td>\n",
       "      <td>-96084.215916</td>\n",
       "      <td>-222832.608351</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    Price  FXDelta(aggregation_level:Type)  Cumulative Cash  \\\n",
       "2025-08-04  703953.846631                     0.000000e+00    -7.039538e+05   \n",
       "2025-08-05  687311.140464                     0.000000e+00    -7.107654e+05   \n",
       "2025-08-06  854096.726246                    -3.725290e-09    -8.382294e+05   \n",
       "2025-08-07  816927.558111                     0.000000e+00    -8.073527e+05   \n",
       "2025-08-08  872578.098512                     3.725290e-09    -8.835696e+05   \n",
       "2025-08-11  685241.758261                     0.000000e+00    -7.508592e+05   \n",
       "2025-08-12  828486.344621                     3.725290e-09    -9.045100e+05   \n",
       "2025-08-13  941680.896567                     0.000000e+00    -1.018543e+06   \n",
       "2025-08-14  749260.469448                     0.000000e+00    -8.496859e+05   \n",
       "2025-08-15  856628.384519                     0.000000e+00    -9.642024e+05   \n",
       "2025-08-18  641537.745039                     0.000000e+00    -8.113467e+05   \n",
       "2025-08-19  644700.871014                     0.000000e+00    -8.292491e+05   \n",
       "2025-08-20  613688.205925                     0.000000e+00    -7.940210e+05   \n",
       "2025-08-21  511073.268607                     0.000000e+00    -6.809239e+05   \n",
       "2025-08-22  776543.772222                    -3.725290e-09    -8.866779e+05   \n",
       "2025-08-25  664120.360916                     0.000000e+00    -8.012825e+05   \n",
       "2025-08-26  564999.536562                     0.000000e+00    -6.674080e+05   \n",
       "2025-08-27  455386.855034                     0.000000e+00    -5.671463e+05   \n",
       "2025-08-28  548765.159018                     0.000000e+00    -6.529257e+05   \n",
       "2025-08-29  600466.953945                     0.000000e+00    -7.083692e+05   \n",
       "2025-09-01  671974.304612                     0.000000e+00    -7.851663e+05   \n",
       "2025-09-02  573496.579288                     0.000000e+00    -6.836700e+05   \n",
       "2025-09-03  607131.223236                     0.000000e+00    -7.163329e+05   \n",
       "2025-09-04  503559.330516                     0.000000e+00    -6.303077e+05   \n",
       "\n",
       "            Transaction Costs          Total  \n",
       "2025-08-04       -6051.326333   -6051.326333  \n",
       "2025-08-05       -8152.522301  -31606.827207  \n",
       "2025-08-06      -10459.843280    5407.461751  \n",
       "2025-08-07      -12918.673655   -3343.859500  \n",
       "2025-08-08      -15413.046675  -26404.562434  \n",
       "2025-08-11      -27756.869337  -93374.336621  \n",
       "2025-08-12      -30066.308412 -106089.987243  \n",
       "2025-08-13      -32748.850904 -109611.008628  \n",
       "2025-08-14      -35363.040760 -135788.422853  \n",
       "2025-08-15      -37917.845073 -145491.909092  \n",
       "2025-08-18      -50344.674601 -220153.667502  \n",
       "2025-08-19      -52490.475935 -237038.675995  \n",
       "2025-08-20      -54613.777845 -234946.554981  \n",
       "2025-08-21      -56539.135316 -226389.725156  \n",
       "2025-08-22      -58690.329946 -168824.470327  \n",
       "2025-08-25      -71027.812708 -208189.945069  \n",
       "2025-08-26      -73018.588822 -175427.020925  \n",
       "2025-08-27      -74700.472260 -186459.928287  \n",
       "2025-08-28      -76370.066582 -180530.610827  \n",
       "2025-08-29      -78259.895976 -186162.158810  \n",
       "2025-09-01      -90314.567163 -203506.572755  \n",
       "2025-09-02      -92322.836654 -202496.244769  \n",
       "2025-09-03      -94248.276676 -203449.928287  \n",
       "2025-09-04      -96084.215916 -222832.608351  "
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hedge_weekly_option_backtest_tcost.result_summary"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "28b1eed4-a466-4ca8-9976-3c17427ab54e",
   "metadata": {},
   "source": [
    "lets plot the pnl of the strategy with and without the transaction costs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "f9652b0c-6a39-4cf3-ab6d-99536594c7a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Axes: >"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAm0AAAGdCAYAAABAcUQ6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB94klEQVR4nO3dd3gU1dfA8e/uJpveK4EUei9KCaF3BFRQsIuI2AAbqKC+9gaCP3svIGLHLmKhIxBa6CWh1xBCgFTS975/TLIkkEAStibn8zz7ZJK5M3Mu2w53btEppRRCCCGEEMKh6e0dgBBCCCGEuDRJ2oQQQgghnIAkbUIIIYQQTkCSNiGEEEIIJyBJmxBCCCG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WPVJ598ogIDA9U333yjlHKe127Z9+iYMWNUx44dL/oeffXVV1VQUJD59ocz1nPJkiXKaDQqFxeXSut5/u2p2lpPpez3WVQa78CBA831fPnll5Ver7+gnnq9Xrm6uprfo6W2bdum/Pz8lKurq5ozZ065fampqWr48OFKr9crg8GgPDw8VLNmzZS7u3uNnxeltM+9sLAwZTAYlNFoVI899pgKCwtT06dPr/R5qe53hL1ffzWpp1JKDRw4UN17773lzrtjx44L6llW2ddfVUnSZmETJ05UDRo0UPv37y/398WLF1d4/z0qKkq98cYb5f62Y8cOFRoaqp566qkqXfOxxx5TXbt2VUppfT/27Nljfpw9e1bt27dPAWrTpk3ljuvVq5d66KGHlFJKLVq0SOn1epWRkVGuTJMmTdS0adOUUkodPHjQfN4xY8aoBg0aqBEjRpg7q5etJ6BOnz5daT1HjRqlhgwZUivr+dprr6mjR48qk8mkpkyZoho3buzw9Tx69OgFr93SpK0qr92XXnpJNWvWzKleu2Xfo2PGjFHdunWrtJ7/+9//VJMmTdQjjzyilHKu92hpPZctW6a8vLzUpEmTLvp8lv3SrM31LGXrz6J27dqpBg0aqLlz55arZ+n7rGHDhuXqGRERoZ566il19OhR83l27NihAgIClKura7mO7ufLzc1VR48eVY8++qiKiIhQrVq1qvHzUlZKSorKyspS2dnZSq/Xqx9++MEc7+V+R9j79VfdepY+L6NHjy5XT6W0/zycX8/zjRo1St18881Vqp9SkrRZjMlkUhMnTlQRERFq9+7dF+wv7WT6448/mv+WmJh4QSfT7du3q9DQUPX4449X+doDBgxQ11133UVjCw8PV6+//rr5bxkZGeU6X/7+++9Kr9errKyscsc2a9ZMvfLKK5XWs7TzZUFBgbme53cyPb+eRUVFKiYmRnl6etbqehYUFKjIyEiHrmdFdS1VmrRV5bX7wgsvqHr16jnVa7essgMRKqrn+++/rwC1bds2p3uPKqV12vby8lLvvffeJZ/P0i/N2l5PpWz7WVT6mREQEKB27959QT1L461Xr565npV9R5QmbO+9916V4u3fv7/y8vJSTz75ZJXjPf95qcjnn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lJScrDw0N98sknTv0ePf8RERFhrufgwYOrdIyz19Oen0WVxde6dWtzPbt06aKGDRtW7e8IQPXu3dscb0REhNLpdApQLi4uauDAgerYsWOX/byMHj1aBQYGKqPRqNq1a6e+/PLLC85Tk89OR3v9VaWeFdmyZYvq0aOHuZ6lfeBKPfLIIyoqKsr8+hs6dOhF586riE4ppRBCCCGEEA5NpvwQQgghhHACkrQJIYQQQjgBSdqEEEIIIZyAJG1CCCGEEE5AkjYhhBBCCCcgSZsQQgghhBOQpE0IIYQQwglI0iaEEEII4QQkaRNCCCGEcAKStAkhhBBCOAFJ2oQQQgghnIAkbUIIIYQQTuD/AZPSgf4u6CRfAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "hedge_weekly_option_backtest_tcost.result_summary['Total'].plot()\n",
    "hedge_weekly_option_backtest.result_summary['Total'].plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5698cf7f-7503-4857-bb09-faaea78b1cb9",
   "metadata": {},
   "source": [
    "we can see that even a relatively low transaction cost of 0.5bp is having a significant effect.  Perhaps we are hedging too frequently.\n",
    "We should go back to basics and look at exactly how much delta the options are producing.\n",
    "We construct a backtest which just buys the calls and hedges on inception and when running the backtest we add the FXDelta risk to the risks to be calculated so\n",
    "we can look at how much delta we are running"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "5bb34a4c-e30b-489f-9119-59ab4c96265d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 96/96 [00:14<00:00,  6.69it/s]\n",
      "100%|███████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:01<00:00,  4.68it/s]\n"
     ]
    }
   ],
   "source": [
    "weekly_hedge_action = HedgeAction(\n",
    "    risk=FXDelta(aggregation_level='Type'),\n",
    "    priceables=FXForward(pair='EURUSD', settlement_date='1w'),\n",
    "    trade_duration='1w',\n",
    "    transaction_cost=t_cost,\n",
    "    name='initial hedge',\n",
    ")\n",
    "# Note we are now hedging with a 1w fwd and holding for a week to tie in to the option schedule\n",
    "weekly_option_and_hedge_trigger = PeriodicTrigger(\n",
    "    PeriodicTriggerRequirements(start_date=dt.date(2025, 8, 4), end_date=dt.date(2025, 9, 4), frequency='1w'),\n",
    "    actions=[add_action_tcost, initial_hedge_action],\n",
    ")\n",
    "weekly_option_strategy = Strategy(initial_portfolio=None, triggers=weekly_option_and_hedge_trigger)\n",
    "weekly_option_backtest = ge.run_backtest(\n",
    "    strategy=weekly_option_strategy,\n",
    "    start=dt.date(2025, 8, 4),\n",
    "    end=dt.date(2025, 9, 4),\n",
    "    frequency='1b',\n",
    "    risks=[FXDelta(aggregation_level='Type')],\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "dfc4c7c5-2176-4bf0-9ff5-ab50954fa897",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Price</th>\n",
       "      <th>FXDelta(aggregation_level:Type)</th>\n",
       "      <th>Cumulative Cash</th>\n",
       "      <th>Transaction Costs</th>\n",
       "      <th>Total</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-08-04</th>\n",
       "      <td>703953.846659</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-703953.846659</td>\n",
       "      <td>-6051.957748</td>\n",
       "      <td>-6051.957748</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-05</th>\n",
       "      <td>680489.942334</td>\n",
       "      <td>-3.667943e+04</td>\n",
       "      <td>-703953.846659</td>\n",
       "      <td>-6051.957748</td>\n",
       "      <td>-29515.862072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-06</th>\n",
       "      <td>719584.630378</td>\n",
       "      <td>4.109436e+06</td>\n",
       "      <td>-703953.846659</td>\n",
       "      <td>-6051.957748</td>\n",
       "      <td>9578.825971</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-07</th>\n",
       "      <td>708224.341558</td>\n",
       "      <td>2.986270e+06</td>\n",
       "      <td>-703953.846659</td>\n",
       "      <td>-6051.957748</td>\n",
       "      <td>-1781.462848</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-08</th>\n",
       "      <td>697124.384618</td>\n",
       "      <td>4.814721e+06</td>\n",
       "      <td>-703953.846659</td>\n",
       "      <td>-6051.957748</td>\n",
       "      <td>-12881.419788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-11</th>\n",
       "      <td>685241.758273</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-780309.659995</td>\n",
       "      <td>-18155.376168</td>\n",
       "      <td>-113223.277890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-12</th>\n",
       "      <td>674788.154801</td>\n",
       "      <td>4.145061e+06</td>\n",
       "      <td>-780309.659995</td>\n",
       "      <td>-18155.376168</td>\n",
       "      <td>-123676.881362</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-13</th>\n",
       "      <td>692719.834444</td>\n",
       "      <td>7.446583e+06</td>\n",
       "      <td>-780309.659995</td>\n",
       "      <td>-18155.376168</td>\n",
       "      <td>-105745.201719</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-14</th>\n",
       "      <td>624955.188757</td>\n",
       "      <td>2.773939e+06</td>\n",
       "      <td>-780309.659995</td>\n",
       "      <td>-18155.376168</td>\n",
       "      <td>-173509.847406</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-15</th>\n",
       "      <td>631145.420649</td>\n",
       "      <td>6.254668e+06</td>\n",
       "      <td>-780309.659995</td>\n",
       "      <td>-18155.376168</td>\n",
       "      <td>-167319.615514</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-18</th>\n",
       "      <td>641537.745113</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-877905.875414</td>\n",
       "      <td>-30269.758474</td>\n",
       "      <td>-266637.888774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-19</th>\n",
       "      <td>626809.676330</td>\n",
       "      <td>4.167375e+05</td>\n",
       "      <td>-877905.875414</td>\n",
       "      <td>-30269.758474</td>\n",
       "      <td>-281365.957557</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-20</th>\n",
       "      <td>630341.541006</td>\n",
       "      <td>-4.598743e+05</td>\n",
       "      <td>-877905.875414</td>\n",
       "      <td>-30269.758474</td>\n",
       "      <td>-277834.092882</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-21</th>\n",
       "      <td>643348.160861</td>\n",
       "      <td>-3.544384e+06</td>\n",
       "      <td>-877905.875414</td>\n",
       "      <td>-30269.758474</td>\n",
       "      <td>-264827.473027</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-22</th>\n",
       "      <td>661875.682949</td>\n",
       "      <td>4.048457e+06</td>\n",
       "      <td>-877905.875414</td>\n",
       "      <td>-30269.758474</td>\n",
       "      <td>-246299.950939</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-25</th>\n",
       "      <td>664120.361072</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-907536.570217</td>\n",
       "      <td>-42405.183716</td>\n",
       "      <td>-285821.392861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-26</th>\n",
       "      <td>698915.609748</td>\n",
       "      <td>-3.066615e+06</td>\n",
       "      <td>-907536.570217</td>\n",
       "      <td>-42405.183716</td>\n",
       "      <td>-251026.144184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-27</th>\n",
       "      <td>706335.164311</td>\n",
       "      <td>-6.185495e+06</td>\n",
       "      <td>-907536.570217</td>\n",
       "      <td>-42405.183716</td>\n",
       "      <td>-243606.589622</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-28</th>\n",
       "      <td>679163.920997</td>\n",
       "      <td>-3.317354e+06</td>\n",
       "      <td>-907536.570217</td>\n",
       "      <td>-42405.183716</td>\n",
       "      <td>-270777.832936</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-29</th>\n",
       "      <td>665284.655358</td>\n",
       "      <td>-1.787266e+06</td>\n",
       "      <td>-907536.570217</td>\n",
       "      <td>-42405.183716</td>\n",
       "      <td>-284657.098575</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-01</th>\n",
       "      <td>671974.304751</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-920687.388437</td>\n",
       "      <td>-54549.799385</td>\n",
       "      <td>-303262.883071</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-02</th>\n",
       "      <td>674996.386998</td>\n",
       "      <td>-2.699085e+06</td>\n",
       "      <td>-920687.388437</td>\n",
       "      <td>-54549.799385</td>\n",
       "      <td>-300240.800823</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-03</th>\n",
       "      <td>671249.433688</td>\n",
       "      <td>-1.665711e+06</td>\n",
       "      <td>-920687.388437</td>\n",
       "      <td>-54549.799385</td>\n",
       "      <td>-303987.754133</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-04</th>\n",
       "      <td>660967.206777</td>\n",
       "      <td>-4.492958e+06</td>\n",
       "      <td>-920687.388437</td>\n",
       "      <td>-54549.799385</td>\n",
       "      <td>-314269.981044</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    Price  FXDelta(aggregation_level:Type)  Cumulative Cash  \\\n",
       "2025-08-04  703953.846659                     0.000000e+00   -703953.846659   \n",
       "2025-08-05  680489.942334                    -3.667943e+04   -703953.846659   \n",
       "2025-08-06  719584.630378                     4.109436e+06   -703953.846659   \n",
       "2025-08-07  708224.341558                     2.986270e+06   -703953.846659   \n",
       "2025-08-08  697124.384618                     4.814721e+06   -703953.846659   \n",
       "2025-08-11  685241.758273                     0.000000e+00   -780309.659995   \n",
       "2025-08-12  674788.154801                     4.145061e+06   -780309.659995   \n",
       "2025-08-13  692719.834444                     7.446583e+06   -780309.659995   \n",
       "2025-08-14  624955.188757                     2.773939e+06   -780309.659995   \n",
       "2025-08-15  631145.420649                     6.254668e+06   -780309.659995   \n",
       "2025-08-18  641537.745113                     0.000000e+00   -877905.875414   \n",
       "2025-08-19  626809.676330                     4.167375e+05   -877905.875414   \n",
       "2025-08-20  630341.541006                    -4.598743e+05   -877905.875414   \n",
       "2025-08-21  643348.160861                    -3.544384e+06   -877905.875414   \n",
       "2025-08-22  661875.682949                     4.048457e+06   -877905.875414   \n",
       "2025-08-25  664120.361072                     0.000000e+00   -907536.570217   \n",
       "2025-08-26  698915.609748                    -3.066615e+06   -907536.570217   \n",
       "2025-08-27  706335.164311                    -6.185495e+06   -907536.570217   \n",
       "2025-08-28  679163.920997                    -3.317354e+06   -907536.570217   \n",
       "2025-08-29  665284.655358                    -1.787266e+06   -907536.570217   \n",
       "2025-09-01  671974.304751                     0.000000e+00   -920687.388437   \n",
       "2025-09-02  674996.386998                    -2.699085e+06   -920687.388437   \n",
       "2025-09-03  671249.433688                    -1.665711e+06   -920687.388437   \n",
       "2025-09-04  660967.206777                    -4.492958e+06   -920687.388437   \n",
       "\n",
       "            Transaction Costs          Total  \n",
       "2025-08-04       -6051.957748   -6051.957748  \n",
       "2025-08-05       -6051.957748  -29515.862072  \n",
       "2025-08-06       -6051.957748    9578.825971  \n",
       "2025-08-07       -6051.957748   -1781.462848  \n",
       "2025-08-08       -6051.957748  -12881.419788  \n",
       "2025-08-11      -18155.376168 -113223.277890  \n",
       "2025-08-12      -18155.376168 -123676.881362  \n",
       "2025-08-13      -18155.376168 -105745.201719  \n",
       "2025-08-14      -18155.376168 -173509.847406  \n",
       "2025-08-15      -18155.376168 -167319.615514  \n",
       "2025-08-18      -30269.758474 -266637.888774  \n",
       "2025-08-19      -30269.758474 -281365.957557  \n",
       "2025-08-20      -30269.758474 -277834.092882  \n",
       "2025-08-21      -30269.758474 -264827.473027  \n",
       "2025-08-22      -30269.758474 -246299.950939  \n",
       "2025-08-25      -42405.183716 -285821.392861  \n",
       "2025-08-26      -42405.183716 -251026.144184  \n",
       "2025-08-27      -42405.183716 -243606.589622  \n",
       "2025-08-28      -42405.183716 -270777.832936  \n",
       "2025-08-29      -42405.183716 -284657.098575  \n",
       "2025-09-01      -54549.799385 -303262.883071  \n",
       "2025-09-02      -54549.799385 -300240.800823  \n",
       "2025-09-03      -54549.799385 -303987.754133  \n",
       "2025-09-04      -54549.799385 -314269.981044  "
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weekly_option_backtest.result_summary"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "05eeadc9-9634-44ae-88b6-58400a547d0f",
   "metadata": {},
   "source": [
    "maybe we can try a strategy which only hedges if the abs(delta) is greater than 4e6.\n",
    "To do this instead of hedging on a periodic basis we need a different type of trigger which triggers dependent on the risk on the strategy.\n",
    "This is the StrategyRiskTrigger"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "f20bed2a-2d0d-4657-ad4c-d60982154b80",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 96/96 [00:16<00:00,  5.91it/s]\n",
      "100%|█████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:10<00:00,  1.98it/s]\n"
     ]
    }
   ],
   "source": [
    "risk_hedge_trigger_up = StrategyRiskTrigger(\n",
    "    RiskTriggerRequirements(\n",
    "        risk=FXDelta(aggregation_level='Type'), trigger_level=4e6, direction=TriggerDirection.ABOVE\n",
    "    ),\n",
    "    actions=named_hedge_action_tcost,\n",
    ")\n",
    "risk_hedge_trigger_down = StrategyRiskTrigger(\n",
    "    RiskTriggerRequirements(\n",
    "        risk=FXDelta(aggregation_level='Type'), trigger_level=-4e6, direction=TriggerDirection.BELOW\n",
    "    ),\n",
    "    actions=named_hedge_action_tcost,\n",
    ")\n",
    "risk_hedge_strategy = Strategy(\n",
    "    initial_portfolio=None, triggers=[weekly_option_and_hedge_trigger, risk_hedge_trigger_up, risk_hedge_trigger_down]\n",
    ")\n",
    "risk_hedge_backtest = ge.run_backtest(\n",
    "    strategy=risk_hedge_strategy, start=dt.date(2025, 8, 4), end=dt.date(2025, 9, 4), frequency='1b'\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "8eb40fed-96b5-4ce5-b6a0-068ffa6099ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>Close</th>\n",
       "      <th>Open Value</th>\n",
       "      <th>Close Value</th>\n",
       "      <th>Long Short</th>\n",
       "      <th>Status</th>\n",
       "      <th>Trade PnL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Action6_Priceable0_2025-08-04</th>\n",
       "      <td>2025-08-04</td>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>0.000015</td>\n",
       "      <td>-28979.558009</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-28979.557994</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action6_Priceable0_2025-08-11</th>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>0.000056</td>\n",
       "      <td>-141949.783377</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-141949.78332</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action6_Priceable0_2025-08-18</th>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>0.00003</td>\n",
       "      <td>-113072.7977</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-113072.79767</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action6_Priceable0_2025-08-25</th>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>-0.000106</td>\n",
       "      <td>50433.378489</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>50433.378383</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Action6_Priceable0_2025-09-01</th>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>None</td>\n",
       "      <td>-0.000032</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>open</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-04</th>\n",
       "      <td>2025-08-04</td>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>-703953.846673</td>\n",
       "      <td>637865.502946</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-66088.343728</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-11</th>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>-685241.75833</td>\n",
       "      <td>685891.313071</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>649.554742</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-18</th>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>-641537.745143</td>\n",
       "      <td>747562.463969</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>106024.718826</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-08-25</th>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>-664120.360966</td>\n",
       "      <td>608390.108042</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-55730.252924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>add action_EURUSD call_2025-09-01</th>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>None</td>\n",
       "      <td>-671974.304719</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>open</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-04</th>\n",
       "      <td>2025-08-04</td>\n",
       "      <td>2025-08-05</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-06</th>\n",
       "      <td>2025-08-06</td>\n",
       "      <td>2025-08-07</td>\n",
       "      <td>-0.000011</td>\n",
       "      <td>5048.991118</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>5048.991107</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-08</th>\n",
       "      <td>2025-08-08</td>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>33553.625264</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>33553.625282</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-11</th>\n",
       "      <td>2025-08-11</td>\n",
       "      <td>2025-08-12</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-12</th>\n",
       "      <td>2025-08-12</td>\n",
       "      <td>2025-08-13</td>\n",
       "      <td>-0.000009</td>\n",
       "      <td>-18791.163959</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>-18791.163968</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-13</th>\n",
       "      <td>2025-08-13</td>\n",
       "      <td>2025-08-14</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>44184.569597</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>44184.56962</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-15</th>\n",
       "      <td>2025-08-15</td>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>0.000027</td>\n",
       "      <td>24885.006478</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>24885.006505</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-18</th>\n",
       "      <td>2025-08-18</td>\n",
       "      <td>2025-08-19</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-22</th>\n",
       "      <td>2025-08-22</td>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>0.000003</td>\n",
       "      <td>312.639056</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>312.639059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-25</th>\n",
       "      <td>2025-08-25</td>\n",
       "      <td>2025-08-26</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-08-27</th>\n",
       "      <td>2025-08-27</td>\n",
       "      <td>2025-08-28</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>34800.42608</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>34800.426102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-09-01</th>\n",
       "      <td>2025-09-01</td>\n",
       "      <td>2025-09-02</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1</td>\n",
       "      <td>closed</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>hedge action_spot hedge_2025-09-04</th>\n",
       "      <td>2025-09-04</td>\n",
       "      <td>None</td>\n",
       "      <td>0.00002</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>open</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                          Open       Close     Open Value  \\\n",
       "Action6_Priceable0_2025-08-04       2025-08-04  2025-08-11       0.000015   \n",
       "Action6_Priceable0_2025-08-11       2025-08-11  2025-08-18       0.000056   \n",
       "Action6_Priceable0_2025-08-18       2025-08-18  2025-08-25        0.00003   \n",
       "Action6_Priceable0_2025-08-25       2025-08-25  2025-09-01      -0.000106   \n",
       "Action6_Priceable0_2025-09-01       2025-09-01        None      -0.000032   \n",
       "add action_EURUSD call_2025-08-04   2025-08-04  2025-08-11 -703953.846673   \n",
       "add action_EURUSD call_2025-08-11   2025-08-11  2025-08-18  -685241.75833   \n",
       "add action_EURUSD call_2025-08-18   2025-08-18  2025-08-25 -641537.745143   \n",
       "add action_EURUSD call_2025-08-25   2025-08-25  2025-09-01 -664120.360966   \n",
       "add action_EURUSD call_2025-09-01   2025-09-01        None -671974.304719   \n",
       "hedge action_spot hedge_2025-08-04  2025-08-04  2025-08-05            0.0   \n",
       "hedge action_spot hedge_2025-08-06  2025-08-06  2025-08-07      -0.000011   \n",
       "hedge action_spot hedge_2025-08-08  2025-08-08  2025-08-11       0.000018   \n",
       "hedge action_spot hedge_2025-08-11  2025-08-11  2025-08-12            0.0   \n",
       "hedge action_spot hedge_2025-08-12  2025-08-12  2025-08-13      -0.000009   \n",
       "hedge action_spot hedge_2025-08-13  2025-08-13  2025-08-14       0.000022   \n",
       "hedge action_spot hedge_2025-08-15  2025-08-15  2025-08-18       0.000027   \n",
       "hedge action_spot hedge_2025-08-18  2025-08-18  2025-08-19            0.0   \n",
       "hedge action_spot hedge_2025-08-22  2025-08-22  2025-08-25       0.000003   \n",
       "hedge action_spot hedge_2025-08-25  2025-08-25  2025-08-26            0.0   \n",
       "hedge action_spot hedge_2025-08-27  2025-08-27  2025-08-28       0.000022   \n",
       "hedge action_spot hedge_2025-09-01  2025-09-01  2025-09-02            0.0   \n",
       "hedge action_spot hedge_2025-09-04  2025-09-04        None        0.00002   \n",
       "\n",
       "                                      Close Value Long Short  Status  \\\n",
       "Action6_Priceable0_2025-08-04       -28979.558009         -1  closed   \n",
       "Action6_Priceable0_2025-08-11      -141949.783377         -1  closed   \n",
       "Action6_Priceable0_2025-08-18        -113072.7977         -1  closed   \n",
       "Action6_Priceable0_2025-08-25        50433.378489         -1  closed   \n",
       "Action6_Priceable0_2025-09-01                   0         -1    open   \n",
       "add action_EURUSD call_2025-08-04   637865.502946         -1  closed   \n",
       "add action_EURUSD call_2025-08-11   685891.313071         -1  closed   \n",
       "add action_EURUSD call_2025-08-18   747562.463969         -1  closed   \n",
       "add action_EURUSD call_2025-08-25   608390.108042         -1  closed   \n",
       "add action_EURUSD call_2025-09-01               0         -1    open   \n",
       "hedge action_spot hedge_2025-08-04            0.0         -1  closed   \n",
       "hedge action_spot hedge_2025-08-06    5048.991118         -1  closed   \n",
       "hedge action_spot hedge_2025-08-08   33553.625264         -1  closed   \n",
       "hedge action_spot hedge_2025-08-11            0.0         -1  closed   \n",
       "hedge action_spot hedge_2025-08-12  -18791.163959         -1  closed   \n",
       "hedge action_spot hedge_2025-08-13   44184.569597         -1  closed   \n",
       "hedge action_spot hedge_2025-08-15   24885.006478         -1  closed   \n",
       "hedge action_spot hedge_2025-08-18            0.0         -1  closed   \n",
       "hedge action_spot hedge_2025-08-22     312.639056         -1  closed   \n",
       "hedge action_spot hedge_2025-08-25            0.0         -1  closed   \n",
       "hedge action_spot hedge_2025-08-27    34800.42608         -1  closed   \n",
       "hedge action_spot hedge_2025-09-01            0.0         -1  closed   \n",
       "hedge action_spot hedge_2025-09-04              0         -1    open   \n",
       "\n",
       "                                        Trade PnL  \n",
       "Action6_Priceable0_2025-08-04       -28979.557994  \n",
       "Action6_Priceable0_2025-08-11       -141949.78332  \n",
       "Action6_Priceable0_2025-08-18       -113072.79767  \n",
       "Action6_Priceable0_2025-08-25        50433.378383  \n",
       "Action6_Priceable0_2025-09-01                None  \n",
       "add action_EURUSD call_2025-08-04   -66088.343728  \n",
       "add action_EURUSD call_2025-08-11      649.554742  \n",
       "add action_EURUSD call_2025-08-18   106024.718826  \n",
       "add action_EURUSD call_2025-08-25   -55730.252924  \n",
       "add action_EURUSD call_2025-09-01            None  \n",
       "hedge action_spot hedge_2025-08-04            0.0  \n",
       "hedge action_spot hedge_2025-08-06    5048.991107  \n",
       "hedge action_spot hedge_2025-08-08   33553.625282  \n",
       "hedge action_spot hedge_2025-08-11            0.0  \n",
       "hedge action_spot hedge_2025-08-12  -18791.163968  \n",
       "hedge action_spot hedge_2025-08-13    44184.56962  \n",
       "hedge action_spot hedge_2025-08-15   24885.006505  \n",
       "hedge action_spot hedge_2025-08-18            0.0  \n",
       "hedge action_spot hedge_2025-08-22     312.639059  \n",
       "hedge action_spot hedge_2025-08-25            0.0  \n",
       "hedge action_spot hedge_2025-08-27   34800.426102  \n",
       "hedge action_spot hedge_2025-09-01            0.0  \n",
       "hedge action_spot hedge_2025-09-04           None  "
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "risk_hedge_backtest.trade_ledger()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b3ef088-41e6-4a7e-be2c-70b30776935d",
   "metadata": {},
   "source": [
    "so now we can see that we hedging on a sparse schedule and if we look at the result summary we can see that the delta is not always zero but that\n",
    "the cumulative transaction costs are lower."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "8589b96c-582f-4b8b-bf12-78caee06eff8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Price</th>\n",
       "      <th>FXDelta(aggregation_level:Type)</th>\n",
       "      <th>Cumulative Cash</th>\n",
       "      <th>Transaction Costs</th>\n",
       "      <th>Total</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2025-08-04</th>\n",
       "      <td>703953.846659</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-703953.846659</td>\n",
       "      <td>-6051.957748</td>\n",
       "      <td>-6051.957748</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-05</th>\n",
       "      <td>680489.942334</td>\n",
       "      <td>-3.667943e+04</td>\n",
       "      <td>-703953.846659</td>\n",
       "      <td>-6051.957748</td>\n",
       "      <td>-29515.862072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-06</th>\n",
       "      <td>719584.630389</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-703953.846670</td>\n",
       "      <td>-6257.577693</td>\n",
       "      <td>9373.206026</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-07</th>\n",
       "      <td>708224.341558</td>\n",
       "      <td>2.986270e+06</td>\n",
       "      <td>-698904.855552</td>\n",
       "      <td>-6463.197637</td>\n",
       "      <td>2856.288369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-08</th>\n",
       "      <td>697124.384600</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-698904.855533</td>\n",
       "      <td>-6704.107429</td>\n",
       "      <td>-8484.578362</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-11</th>\n",
       "      <td>685241.758273</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-741707.043607</td>\n",
       "      <td>-19048.435640</td>\n",
       "      <td>-75513.720973</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-12</th>\n",
       "      <td>674788.154810</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-741707.043616</td>\n",
       "      <td>-19255.838305</td>\n",
       "      <td>-86174.727110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-13</th>\n",
       "      <td>692719.834422</td>\n",
       "      <td>9.313226e-10</td>\n",
       "      <td>-760498.207553</td>\n",
       "      <td>-19835.838794</td>\n",
       "      <td>-87614.211925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-14</th>\n",
       "      <td>624955.188757</td>\n",
       "      <td>2.773939e+06</td>\n",
       "      <td>-716313.637955</td>\n",
       "      <td>-20208.436618</td>\n",
       "      <td>-111566.885817</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-15</th>\n",
       "      <td>631145.420621</td>\n",
       "      <td>9.313226e-10</td>\n",
       "      <td>-716313.637928</td>\n",
       "      <td>-20521.395873</td>\n",
       "      <td>-105689.613179</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-18</th>\n",
       "      <td>641537.745113</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-789024.846869</td>\n",
       "      <td>-32948.737433</td>\n",
       "      <td>-180435.839189</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-19</th>\n",
       "      <td>626809.676331</td>\n",
       "      <td>4.167375e+05</td>\n",
       "      <td>-789024.846869</td>\n",
       "      <td>-32948.737433</td>\n",
       "      <td>-195163.907971</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-20</th>\n",
       "      <td>630341.541006</td>\n",
       "      <td>-4.598743e+05</td>\n",
       "      <td>-789024.846869</td>\n",
       "      <td>-32948.737433</td>\n",
       "      <td>-191632.043296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-21</th>\n",
       "      <td>643348.160860</td>\n",
       "      <td>-3.544384e+06</td>\n",
       "      <td>-789024.846869</td>\n",
       "      <td>-32948.737433</td>\n",
       "      <td>-178625.423442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-22</th>\n",
       "      <td>661875.682946</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-789024.846865</td>\n",
       "      <td>-33151.307018</td>\n",
       "      <td>-160300.470937</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-25</th>\n",
       "      <td>664120.361072</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-818342.902612</td>\n",
       "      <td>-45489.301845</td>\n",
       "      <td>-199711.843385</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-26</th>\n",
       "      <td>698915.609748</td>\n",
       "      <td>-3.066615e+06</td>\n",
       "      <td>-818342.902612</td>\n",
       "      <td>-45489.301845</td>\n",
       "      <td>-164916.594709</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-27</th>\n",
       "      <td>706335.164289</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-818342.902590</td>\n",
       "      <td>-45798.836086</td>\n",
       "      <td>-157806.574388</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-28</th>\n",
       "      <td>679163.920997</td>\n",
       "      <td>-3.317354e+06</td>\n",
       "      <td>-783542.476510</td>\n",
       "      <td>-46108.370327</td>\n",
       "      <td>-150486.925841</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-08-29</th>\n",
       "      <td>665284.655358</td>\n",
       "      <td>-1.787266e+06</td>\n",
       "      <td>-783542.476510</td>\n",
       "      <td>-46108.370327</td>\n",
       "      <td>-164366.191480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-01</th>\n",
       "      <td>671974.304751</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-796693.294730</td>\n",
       "      <td>-58252.985996</td>\n",
       "      <td>-182971.975975</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-02</th>\n",
       "      <td>674996.386999</td>\n",
       "      <td>-2.699085e+06</td>\n",
       "      <td>-796693.294730</td>\n",
       "      <td>-58252.985996</td>\n",
       "      <td>-179949.893727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-03</th>\n",
       "      <td>671249.433689</td>\n",
       "      <td>-1.665711e+06</td>\n",
       "      <td>-796693.294730</td>\n",
       "      <td>-58252.985996</td>\n",
       "      <td>-183696.847037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-09-04</th>\n",
       "      <td>660967.206757</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-796693.294710</td>\n",
       "      <td>-58477.796095</td>\n",
       "      <td>-194203.884048</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    Price  FXDelta(aggregation_level:Type)  Cumulative Cash  \\\n",
       "2025-08-04  703953.846659                     0.000000e+00   -703953.846659   \n",
       "2025-08-05  680489.942334                    -3.667943e+04   -703953.846659   \n",
       "2025-08-06  719584.630389                     0.000000e+00   -703953.846670   \n",
       "2025-08-07  708224.341558                     2.986270e+06   -698904.855552   \n",
       "2025-08-08  697124.384600                     0.000000e+00   -698904.855533   \n",
       "2025-08-11  685241.758273                     0.000000e+00   -741707.043607   \n",
       "2025-08-12  674788.154810                     0.000000e+00   -741707.043616   \n",
       "2025-08-13  692719.834422                     9.313226e-10   -760498.207553   \n",
       "2025-08-14  624955.188757                     2.773939e+06   -716313.637955   \n",
       "2025-08-15  631145.420621                     9.313226e-10   -716313.637928   \n",
       "2025-08-18  641537.745113                     0.000000e+00   -789024.846869   \n",
       "2025-08-19  626809.676331                     4.167375e+05   -789024.846869   \n",
       "2025-08-20  630341.541006                    -4.598743e+05   -789024.846869   \n",
       "2025-08-21  643348.160860                    -3.544384e+06   -789024.846869   \n",
       "2025-08-22  661875.682946                     0.000000e+00   -789024.846865   \n",
       "2025-08-25  664120.361072                     0.000000e+00   -818342.902612   \n",
       "2025-08-26  698915.609748                    -3.066615e+06   -818342.902612   \n",
       "2025-08-27  706335.164289                     0.000000e+00   -818342.902590   \n",
       "2025-08-28  679163.920997                    -3.317354e+06   -783542.476510   \n",
       "2025-08-29  665284.655358                    -1.787266e+06   -783542.476510   \n",
       "2025-09-01  671974.304751                     0.000000e+00   -796693.294730   \n",
       "2025-09-02  674996.386999                    -2.699085e+06   -796693.294730   \n",
       "2025-09-03  671249.433689                    -1.665711e+06   -796693.294730   \n",
       "2025-09-04  660967.206757                     0.000000e+00   -796693.294710   \n",
       "\n",
       "            Transaction Costs          Total  \n",
       "2025-08-04       -6051.957748   -6051.957748  \n",
       "2025-08-05       -6051.957748  -29515.862072  \n",
       "2025-08-06       -6257.577693    9373.206026  \n",
       "2025-08-07       -6463.197637    2856.288369  \n",
       "2025-08-08       -6704.107429   -8484.578362  \n",
       "2025-08-11      -19048.435640  -75513.720973  \n",
       "2025-08-12      -19255.838305  -86174.727110  \n",
       "2025-08-13      -19835.838794  -87614.211925  \n",
       "2025-08-14      -20208.436618 -111566.885817  \n",
       "2025-08-15      -20521.395873 -105689.613179  \n",
       "2025-08-18      -32948.737433 -180435.839189  \n",
       "2025-08-19      -32948.737433 -195163.907971  \n",
       "2025-08-20      -32948.737433 -191632.043296  \n",
       "2025-08-21      -32948.737433 -178625.423442  \n",
       "2025-08-22      -33151.307018 -160300.470937  \n",
       "2025-08-25      -45489.301845 -199711.843385  \n",
       "2025-08-26      -45489.301845 -164916.594709  \n",
       "2025-08-27      -45798.836086 -157806.574388  \n",
       "2025-08-28      -46108.370327 -150486.925841  \n",
       "2025-08-29      -46108.370327 -164366.191480  \n",
       "2025-09-01      -58252.985996 -182971.975975  \n",
       "2025-09-02      -58252.985996 -179949.893727  \n",
       "2025-09-03      -58252.985996 -183696.847037  \n",
       "2025-09-04      -58477.796095 -194203.884048  "
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "risk_hedge_backtest.result_summary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8a64c520-9803-47f5-b1e9-9672676f9c12",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
